// import Vue from 'vue'
const state = {
    roleItem: [],
    defaultRoleAwardSize: {},
    roleGroups: [],
    roleAwards: [],
}
const getters = {
    //获取绘本角色
    getRoleItem(state) {
        return state.roleItem;
    },
    //获取个人中心中阅读过的角色
    getRoleGroups(state) {
        return state.roleGroups
    },
    //获取绘本奖励的角色
    getRoleAwards(state) {
        return state.roleAwards
    },
    //获取奖励角色尺寸
    getDefaultRoleAwardSize(state) {
        return state.defaultRoleAwardSize
    },
};
const mutations = {
    //初始化绘本角色
    setRoleItem(state, param) {
        state.roleItem = param

    },
    //初始化角色 角色对象个人中心中阅读过的角色 
    setRoleGroups(state, param) {
        state.roleGroups = param
    },
    //初始化绘本奖励角色
    setRoleAwards(state, param) {
        state.roleAwards = param
    },
    //初始化奖励角色尺寸
    setDefaultRoleAwardSize(state, param) {
        state.defaultRoleAwardSize = param
    }
};
const actions = {
    setRoleItem({
        commit
    }, param) {
        commit('setRoleItem', param);
    },
    setRoleGroups({ commit }, param) {
        commit("setRoleGroups", param)
    },
    setRoleAwards({
        commit
    }, param) {
        commit("setRoleAwards", param)
    },
    setDefaultRoleAwardSize({ commit }, param) {
        commit("setDefaultRoleAwardSize", param)
    }
};
export default {
    namespaced: true, //用于在全局引用此文件里的方法时标识这一个的文件名
    state,
    getters,
    mutations,
    actions
}